/*
 *
 *      Copyright (c) 2018-2025, waterx All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the pig4cloud.com developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: waterx
 *
 */

package com.example.tenant.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.tenant.Converter.CustomStringConverter;
import com.example.tenant.Converter.LongStringConverter;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * <p>
 * 客户端信息
 * </p>
 *
 * @author waterx
 * @since 2018-05-15
 */
@Data
@ColumnWidth(10)
@EqualsAndHashCode(callSuper = true)
public class SysOauthClientDetails extends Model<SysOauthClientDetails> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @ExcelProperty("id")
    private String id;

    /**
     * 应用名称
     */
    @ExcelProperty("client_name")
    private String clientName;

    /**
     * 应用访问地址
     */
    @ExcelProperty("client_url")
    private String clientUrl;

    /**
     * 登录地址
     */
    @ExcelProperty("web_server_login_uri")
    private String webServerLoginUri;

    /**
     * 获取token地址
     */
    @ExcelProperty("web_server_token_uri")
    private String webServerTokenUri;

    /**
     * 获取用户信息地址
     */
    @ExcelProperty("web_server_user_uri")
    private String webServerUserUri;

    /**
     * 登出地址
     */
    @ExcelProperty("web_server_logout_uri")
    private String webServerLogoutUri;

    /**
     * 客户端ID
     */
    @ExcelProperty("client_id")
    private String clientId;

    /**
     * 客户端密钥
     */
    @ExcelProperty("client_secret")
    private String clientSecret;

    /**
     * 资源ID
     */
    @ExcelProperty("resource_ids")
    private String resourceIds;

    /**
     * 作用域
     */
    @ExcelProperty("scope")
    private String scope;

    /**
     * 授权方式[A,B,C]
     */
    @ExcelProperty("authorized_grant_types")
    private String authorizedGrantTypes;

    /**
     * 回调地址
     */
    @ExcelProperty("web_server_redirect_uri")
    private String webServerRedirectUri;

    /**
     * 权限
     */
    @ExcelProperty("authorities")
    private String authorities;

    /**
     * 请求令牌有效时间
     */
    @ExcelProperty("access_token_validity")
    private Integer accessTokenValidity;

    /**
     * 刷新令牌有效时间
     */
    @ExcelProperty("refresh_token_validity")
    private Integer refreshTokenValidity;

    /**
     * 扩展信息
     */
    @ExcelProperty("additional_information")
    private String additionalInformation;

    /**
     * 是否自动放行
     */
    @ExcelProperty("autoapprove")
    private String autoapprove;

    /**
     * 图标
     */
    @ExcelProperty("icon")
    private String icon;

    /**
     * 排序值
     */
    @ExcelProperty("sort_order")
    private Integer sortOrder;

    /**
     * 应用完整展示（0 否 1是）
     */
    @ExcelProperty("complete")
    private String complete;

    /**
     * 默认应用 (0 否 1 是)
     */
    @ExcelProperty("default_client")
    private String defaultClient;

    /**
     * 是否外部应用(0 否 1是)
     */
    @ExcelProperty("out")
    private String out;

    /**
     * 创建人
     */
    @ExcelProperty(value = "create_by", converter = CustomStringConverter.class)
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    /**
     * 创建时间
     */
    @ExcelProperty("create_time")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelProperty(value = "update_by", converter = CustomStringConverter.class)
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelProperty("update_time")
    private Date updateTime;

    /**
     * 删除标记
     */
    @TableField(fill = FieldFill.INSERT)
    @ExcelProperty("del_flag")
    private String delFlag;

    /**
     * 租户id
     */
    @ExcelProperty(value = "tenant_id", converter = LongStringConverter.class)
    private Long tenantId;
}
